<?php
namespace models\repositories;
use Doctrine\ORM\EntityRepository;
use entities;
class ProfileRepository extends EntityRepository {
	public function testIterate(){
		echo "<br>iterasi x";
	}
	public function findAllAsObject(){
		$qb = $this->_em->createQueryBuilder();		
		$qb->select('Profile')
		   ->from('models\entities\Profile', 'Profile')
		;
		
		$query = $qb->getQuery();
		return $query->getResult();
	}
	
	public function findByIdAsObject($id){
		$qb = $this->_em->createQueryBuilder();		
		$qb->select('Profile')
		   ->from('models\entities\Profile', 'Profile')		   
		   ->where('Profile.id = ?1')
		;
		
		$qb->setParameter(1, $id);
		$query = $qb->getQuery();
		return $query->getResult();
	}
}

